Class Environment
- java.lang.Object
-
- com.supermap.data.Environment
-
public class Environment extends java.lang.Object
This environment class is used to manage the configuration information about develop environment, for example setting the location folder saved the cache file and setting the equal-zero precision. Through this class you can set the ratio of device coordinate (pixel) to logical coordinate.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
Environment.Language
Navigation language type.
-
Field Summary
Fields Modifier and Type Field and Description static double
DEFAULT_MAX_EQUAL_ZERO_PRECISION
The default value is 0, used to determine the maximum precision.static double
DEFAULT_MIN_EQUAL_ZERO_PRECISION
The default value is 0, used to determine the minimum precision.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description static java.lang.String
getBuildVersion(android.content.Context context)
Gets compiled version information.static java.lang.String
getConfigFileDirectory()
Deprecated.This interface is deprecated. Not provided any longer. Gets the path of the configuration file needed for storing SuperMap iMobile for Android.static java.lang.String
getDeviceID()
Gets the device number of the current equipment, used to apply for license.static Environment.Language
getLanguage()
Gets the language.static java.lang.String
getLicensePath()
Gets the path that stores the license file.static LicenseStatus
getLicenseStatus()
Gets the license status.static double
getMaxEqualZeroPrecision()
Returns the maximum equal-zero precision that is used to determine whether the float value and double value are zero.static double
getMinEqualZeroPrecision()
Returns the minimum equal-zero precision that is used to determine whether the float value and double value are zero.static java.lang.String
getTemporaryPath()
Gets the path that stores the temporary file.static java.lang.String
getWebCacheDirectory()
Gets the path that stores the network map cache.static boolean
initialization(android.content.Context context)
Initializing environment.static boolean
isOpenGLMode()
Gets whether the current display mode is OpenGL.static boolean
isSingleThreadEnable()
Get whether the mapping mode is single-threaded.static void
resetDeviceID()
Reset DeviceID, which is used to obtain the error deviceID by misoperation.static void
setConfigFileDirectory(java.lang.String config)
Deprecated.This interface is deprecated. Not provided any longer. Sets the path of the configuration file, used to store the configuration file needed for SuperMap iMobile for Android.static void
setDebugMode(boolean isDebugMode)
Sets the debug mode.static void
setFonsPath3D()
Sets the 3D font path.static void
setFontsPath(java.lang.String fontsPath)
Sets the fonts path.static void
setLanguage(Environment.Language language)
Sets languagestatic void
setLicensePath(java.lang.String path)
Sets the path that stores the license file.static void
setLicenseType(LicenseType type)
Sets the license type.static void
setOpenGLMode(boolean isOpenGLMode)
Sets the display mode to OpenGL mode.static void
setSingleThreadEnable(boolean singleThreadEnable)
Set whether the mapping mode is single-threaded.static void
setTemporaryPath(java.lang.String tempPath)
Sets the path that stores the temporary file.static void
setWebCacheDirectory(java.lang.String webCache)
Sets the path that stores the network map cache.
-
-
-
Field Detail
-
DEFAULT_MAX_EQUAL_ZERO_PRECISION
public static final double DEFAULT_MAX_EQUAL_ZERO_PRECISION
The default value is 0, used to determine the maximum precision. The default maximum equal-zero precision is the upper limit of the precision range. while this field is static read-only, and user can not modify it.- See Also:
Toolkit
, Constant Field Values- Default:
- The default value is 1E-10.
-
DEFAULT_MIN_EQUAL_ZERO_PRECISION
public static final double DEFAULT_MIN_EQUAL_ZERO_PRECISION
The default value is 0, used to determine the minimum precision. The default maximum equal-zero precision is the lower limit of the precision range. while this field is static read-only, and user can not modify it.- See Also:
Toolkit
, Constant Field Values- Default:
- The default value is -1E-10.
-
-
Method Detail
-
getMaxEqualZeroPrecision
public static double getMaxEqualZeroPrecision()
Returns the maximum equal-zero precision that is used to determine whether the float value and double value are zero. If the value returned or set is in the precision range from MinEqualPrecision to MaxEqualPrecision, the value equals to zero. Namely, if a is the returned value or set value, when a is not less than the MinEqualPrecision and greater than the MaxEqualPrecision, then the a equals to zero. Note: The MaxEqualPrecision is greater than and equals to the MinEqualPrecision in fact, but which is not defined in this version.- Returns:
- the maximum equal-zero precision that is used to determine whether the float value and double value are zero.
- See Also:
Toolkit
- Default:
- The default value is 1E-10.
-
getMinEqualZeroPrecision
public static double getMinEqualZeroPrecision()
Returns the minimum equal-zero precision that is used to determine whether the float value and double value are zero. If the value returned or set is in the precision range from MinEqualPrecision to MaxEqualPrecision, the value equals to zero. Namely, if a is the returned value or set value, when a is not less than the MinEqualPrecision and greater than the MaxEqualPrecision, then the a equals to zero. Note: The MaxEqualPrecision is greater than and equals to the MinEqualPrecision in fact, but which is not defined in this version.- Returns:
- the minimum equal-zero precision that is used to determine whether the float value and double value are zero.
- See Also:
Toolkit
- Default:
- The default value is -1E-10.
-
getConfigFileDirectory
public static java.lang.String getConfigFileDirectory()
Deprecated. This interface is deprecated. Not provided any longer. Gets the path of the configuration file needed for storing SuperMap iMobile for Android.- Returns:
- The path that stores the configuration file.
- Default:
- The default path to the configuration file is the application data directory.
-
setConfigFileDirectory
public static void setConfigFileDirectory(java.lang.String config)
Deprecated. This interface is deprecated. Not provided any longer. Sets the path of the configuration file, used to store the configuration file needed for SuperMap iMobile for Android.- Parameters:
config
- The path that stores the configuration file.- Default:
- The default path to the configuration file is the application data directory.
-
getDeviceID
public static java.lang.String getDeviceID()
Gets the device number of the current equipment, used to apply for license.- Returns:
- The device number of the current equipment
-
getLicensePath
public static java.lang.String getLicensePath()
Gets the path that stores the license file.- Returns:
- The path that stores the license file.
-
setLicensePath
public static void setLicensePath(java.lang.String path)
Sets the path that stores the license file.- Parameters:
path
- The path that stores the license file.
-
getWebCacheDirectory
public static java.lang.String getWebCacheDirectory()
Gets the path that stores the network map cache.- Returns:
- The path that stores the network map cache.
-
setWebCacheDirectory
public static void setWebCacheDirectory(java.lang.String webCache)
Sets the path that stores the network map cache.- Parameters:
webCache
- the path that stores the network map cache.
-
setFontsPath
public static void setFontsPath(java.lang.String fontsPath)
Sets the fonts path.If there is no display fonts in the computer, you can put the related font to the parameter path, and call this method after calling the initialization method
initialization()
.- Parameters:
fontsPath
- the fonts path.
-
getTemporaryPath
public static java.lang.String getTemporaryPath()
Gets the path that stores the temporary file.- Returns:
- The path that stores the temporary file.
- Default:
- The default path is /SuperMap/temp/, if setTemporaryPath is set, return the value.
-
setTemporaryPath
public static void setTemporaryPath(java.lang.String tempPath)
Sets the path that stores the temporary file.Some temporary data will be created when using SuperMap iMobile for Android, this method can store the temporary data here, it is recommended to use the cache file in the installation directory.
- Parameters:
tempPath
- The path that stores the temporary file.- Default:
- The default path is /SuperMap/temp/.
-
initialization
public static boolean initialization(android.content.Context context)
Initializing environment.Users must call this method in the main thread to configure the environment of SuperMap iMobile for Android.
- Parameters:
context
- Android context environment.- Returns:
- Whether the environment status is normal, return true if it is normal.
-
getLicenseStatus
public static LicenseStatus getLicenseStatus()
Gets the license status.- Returns:
- The current license status.
-
setDebugMode
public static void setDebugMode(boolean isDebugMode)
Sets the debug mode.It is suggested to use in the debug mode. The system will generate a log folder for outputting logs of running information, and the folder is at the same path level of the configure file getTemporaryPath()
- Parameters:
isDebugMode
- A bool type parameter. It is in the debug mode if the value is true; otherwise, the debug mode is invalid.
-
setOpenGLMode
public static void setOpenGLMode(boolean isOpenGLMode)
Sets the display mode to OpenGL mode. (note: Android 4.0 or above supports GL mode rendering)Note:The OpenGL display mode does not support a map with a crop range set.
1.The OpenGL display mode does not support a map with a crop range set.
2.The OpenGL display mode has an anti-aliasing effect turned on by default and does not need to be set again.
- Parameters:
isOpenGLMode
- When it is true, use OpenGL to display; otherwise, use the original display mode
-
isOpenGLMode
public static boolean isOpenGLMode()
Gets whether the current display mode is OpenGL.Note:The OpenGL display mode does not support a map with a crop range set.
- Returns:
- Return true to show the current display mode, otherwise the current display mode.
-
setFonsPath3D
public static void setFonsPath3D()
Sets the 3D font path.
-
setLanguage
public static void setLanguage(Environment.Language language)
Sets language- Parameters:
language
- the type language
-
getLanguage
public static Environment.Language getLanguage()
Gets the language.- Returns:
- The current type language
-
getBuildVersion
public static java.lang.String getBuildVersion(android.content.Context context)
Gets compiled version information.- Parameters:
context
- app or the context of the activity, if theinitialization(Context)
call initialization () after the use of the interface, can be directly.- Returns:
- Returns the version information, valid format: ver_xx_xx_xx, "xx" stands for multi-digit. If you do not get the version information, return "Unknown".
-
setLicenseType
public static void setLicenseType(LicenseType type)
Sets the license type.LicenseType.DEVICEID
is by default.When using a return-type license (refer to
RecycleLicenseManager
) which is introduced from SuperMap 9D, the licese type should be set to UUID.- Parameters:
type
- License Type
-
resetDeviceID
public static void resetDeviceID()
Reset the DeviceID, which is used to obtain the wrong deviceID by mistake. [Permission required: file reading and writing]
-
setSingleThreadEnable
public static void setSingleThreadEnable(boolean singleThreadEnable)
Set whether the map drawing mode is single-threaded. It is valid whenisOpenGLMode()
is true. Default is false.- Parameter:
singleThreadEnable
- Whether it is single-threaded mode
-
isSingleThreadEnable
public static boolean isSingleThreadEnable()
Find out if the mapping pattern is single threaded.It is valid whenisOpenGLMode()
is true. Default is false.- Return:
- The map drawing mode a single thread
-
-